/**
 * 
 */
package com.base.myproject.client.ui;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * @author zgw
 *2009-10-30 上午10:17:22
 * javazgw@gmail.com
 */
public class Loading {

	static Loading loading;
	private Loading()
	{
		
	}
	public static Loading getinstance()
	{
		if(loading==null)
		{
			loading = new Loading();
		}
		return loading;
	}
	public void loading()
	{
		 DOM.setInnerHTML(RootPanel.get("Loading-Message").getElement(), "<img src=\"images/baseimage/ajax-loader.gif\"  alt=\"loading\"> <a style='font-size: 12px;'>与服务器通信中，请等待...</a>");
	}
	public void loaded()
	{
		 DOM.setInnerHTML(RootPanel.get("Loading-Message").getElement(), "");
	}
	
	public void connecting(String text)
	{
		 DOM.setInnerHTML(RootPanel.get("connection").getElement(), "<img src=\"images/baseimage/ajax-loader.gif\"  alt=\"loading\"> <a style='font-size: 12px;'> "+(text==null?"与服务器通信中，请等待...":text)+"</a>");
			
	}
	public void connected()
	{
		DOM.setInnerHTML(RootPanel.get("connection").getElement(), "");
	}
	
}
